package core.cards.election.gui;

import org.eclipse.jface.wizard.Wizard;

import core.cards.election.model.VotingCard;

public class WzdAddEditVotingCard extends Wizard {

	private boolean addVotingCard;
	private VotingCard votingCard;

	private WzdPgAddEditVotingCard wzdPgAddEditVotingCard;

	public WzdAddEditVotingCard(boolean addVotingCard, VotingCard votingCard) {
		if (addVotingCard) {
			setWindowTitle("Add Voting Card");
		} else {
			setWindowTitle("Edit Voting Card");
		}

		this.addVotingCard = addVotingCard;
		this.votingCard = votingCard;
	}

	@Override
	public void addPages() {
		wzdPgAddEditVotingCard = new WzdPgAddEditVotingCard(addVotingCard, votingCard);
		addPage(wzdPgAddEditVotingCard);
	}

	@Override
	public boolean performFinish() {
		wzdPgAddEditVotingCard.update();
		return true;
	}

}
